//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) Microsoft Corporation. All rights reserved.

Module Name:

misc.h

Abstract:


Notes:

--*/

/*
------------------------------------------------------------------------------
    Revision History
    Date            Author             Activity ID               Activity Headline
    2007-03-09     qinxuetao          CEDB200046239            Update ril driver to enable AT command test through extended ATCI
    2007-04-17     qinxuetao          WM600002434              Modified rilpm for Lampson.
    2007-04-26     qinxuetao          WM600002433              Add +TEDGE to get the access technology
    2007-04-29     hanjianjun         WM600003902              modified after resume the icon if battery cann't refresh.      
    2007-07-13     qinxuetao          WM600009088              Set OEM default time on first boot or clean boot
    2007-08-21     qinxuetao          WM600014210              Get BT address from modem when device power on
------------------------------------------------------------------------------
*/

#pragma once


#define MISC_CMDBUF_LENGTH_PB    (MAX_PATH + MAXLENGTH_ADDRESS + MAXLENGTH_PHONEBOOKTEXT)
#define MISC_CMDBUF_LENGTH_COST  (2 * MAX_PATH + 3 * MAXLENGTH_PASSWORD + MAXLENGTH_CURRENCY)
#define MISC_CMDBUF_LENGTH_PBLOC  20
#define MISC_ALLOC_NUMBER        16
#if defined (OEM1_DRIVER) || defined(OEM2_DRIVER)
#define RIL_DEVSPECIFICPARAM_FLOWCONTROL        3
#endif
#ifdef OEM1_DRIVER
#define RIL_DEVSPECIFICPARAM_BUILDINFO          1
#define RIL_DEVSPECIFICPARAM_BATTERYINFO        2
#endif
#ifdef SIMULATE_REBOOT_RADIO
#define RIL_DEVSPECIFICPARAM_REBOOTRADIO                4242
#endif // SIMULATE_REBOOT_RADIO
#ifdef SIMULATE_HUNG_RADIO
#define RIL_DEVSPECIFICPARAM_SIMULATEHUNGRADIO      4243
#endif // SIMULATE_HUNG_RADIO
#define RIL_DEVSPECIFICPARAM_SIMULATE_NW_DEACT      4244    // Use detailed data struct. lpData points to a RILGPRSCONTEXTACTIVATED struct.

typedef struct detailedrildevspecific_tag {
    DWORD cbSize;                       // @field structure size in bytes
    DWORD dwDevSpecificCommand;         // one of the RIL_DEVSPECIFICPARAM_ that require data
    PVOID lpData;                      // pointer to data specific to dwDevSpecificCommand
} DETAILEDRILDEVSPECIFIC, *LPDETAILEDRILDEVSPECIFIC;


HRESULT RILDrv_GetPhonebookOptions(DWORD dwParam);
HRESULT RILDrv_SetPhonebookOptions(DWORD dwParam, const RILPHONEBOOKINFO* lpPhonebookInfo);
HRESULT RILDrv_ReadPhonebookEntries(DWORD dwParam, DWORD dwStartIndex, DWORD dwEndIndex);
HRESULT RILDrv_WritePhonebookEntry(DWORD dwParam, const RILPHONEBOOKENTRY* lpEntry);
HRESULT RILDrv_DeletePhonebookEntry(DWORD dwParam, DWORD dwIndex);
HRESULT RILDrv_SendSimCmd(DWORD dwParam, const BYTE* lpbCommand, DWORD dwSize);
HRESULT RILDrv_SendRestrictedSimCmd(DWORD dwParam, DWORD dwCommand, const RILSIMCMDPARAMETERS* lpParameters,
                                    const BYTE* lpbData, DWORD dwSize);
HRESULT RILDrv_GetSimRecordStatus(DWORD dwParam, DWORD dwFileID);
HRESULT RILDrv_GetSimToolkitProfile(DWORD dwParam);
HRESULT RILDrv_SetSimToolkitProfile(DWORD dwParam, const BYTE* lpbProfile, DWORD dwSize);
HRESULT RILDrv_SendSimToolkitEnvelopeCmd(DWORD dwParam, const BYTE* lpbCommand, DWORD dwSize);
HRESULT RILDrv_SendSimToolkitCmdResponse(DWORD dwParam, const RILSIMTOOLKITRSP* pRsp, LPBYTE pDetails, const DWORD dwDetailSize);
HRESULT RILDrv_TerminateSimToolkitSession(DWORD dwParam, DWORD dwCause);
HRESULT RILDrv_SendSimToolkitEventDownload(DWORD dwParam, const DWORD dwEvent, LPBYTE pData, const DWORD dwDataSize);
HRESULT RILDrv_GetEquipmentInfo(DWORD dwParam);
HRESULT RILDrv_GetEquipmentState(DWORD dwParam);
HRESULT RILDrv_SetEquipmentState(DWORD dwParam, DWORD dwEquipmentState);
HRESULT RILDrv_GetCostInfo(DWORD dwParam);
HRESULT RILDrv_SetCostInfo(DWORD dwParam, const RILCOSTINFO* lpCostInfo, LPCSTR lpszPassword);
HRESULT RILDrv_GetSignalQuality(DWORD dwParam);
HRESULT RILDrv_GetCellTowerInfo(DWORD dwParam);
HRESULT RILDrv_DevSpecific(DWORD dwParam, const BYTE* lpbParams, DWORD dwSize);

HRESULT RILDrv_GetCurrentSystemType(DWORD dwParam);
HRESULT RILDrv_GetRoamingMode(DWORD dwParam);
HRESULT RILDrv_SetRoamingMode(DWORD dwParam, DWORD dwRoamingMode);
HRESULT RILDrv_GetPreferredPrivacyMode(DWORD dwParam);
HRESULT RILDrv_SetPreferredPrivacyMode(DWORD dwParam, DWORD dwPreferredPrivacyMode);
HRESULT RILDrv_GetCurrentPrivacyStatus(DWORD dwParam);
HRESULT RILDrv_GetATR(DWORD dwParam);
BOOL ParseSignalQualityData(LPCSTR szRsp, RILSIGNALQUALITY* prsq, LPCSTR &rszPointer);
HRESULT ParseGetEquipmentState(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
HRESULT RILDrv_LogEventToRadio(DWORD dwParam, LPCSTR szLog);
HRESULT RILDrv_CtrlAudio(DWORD dwParam, LPDETAILEDRILDEVSPECIFIC devspsec);
HRESULT RILDrv_GetBandStatus();
HRESULT RILDrv_GetAccessTech();
HRESULT RILDrv_GetBTAddress();
HRESULT ParseSendRestrictedSimCmd(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
HRESULT ParseGetSimRecordStatus(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
#ifdef RIL_ENABLE_TIMESYNC
#define RILRTC_CONTROL_ROOT    HKEY_LOCAL_MACHINE
#define RILRTC_CONTROL_PATH    TEXT("Software\\Microsoft\\RIL\\TimeSync")
#define RILRTC_CONTROL_FIRSTPOWERON   TEXT("FirstPowerON")
#define RILRTC_CONTROL_DEFAULTTIME    TEXT("DefaultTime")
#define RILRTC_CONTROL_MINIMUMTIME    TEXT("MinimumTime")
#define RILRTC_CONTROL_MAXIMUMTIME    TEXT("MaximumTime")
#define STATE_TIME_ROOT  HKEY_LOCAL_MACHINE
#define STATE_TIME_PATH  TEXT("SYSTEM\\STATE\\DATETIME")
#define STATE_TIME_VALUE TEXT("TIME")
#define FORMAT_UPDATE_ROOT  HKEY_LOCAL_MACHINE
#define FORMAT_UPDATE_PATH  TEXT("System\\State\\Hardware")
#define FORMAT_UPDATE_VALUE TEXT("FormatUserSeting")
BOOL StartTimeSync();
BOOL SetSystemTimeToDevice( const SYSTEMTIME *pSTime , BOOL fSetModem, BOOL fSetPPC);
BOOL SetFileTimeToDevice( const FILETIME *pFTime , BOOL fSetModem, BOOL fSetPPC);
HRESULT PrintFileTime(const FILETIME *pFTime , LPCSTR szRemark);
HRESULT PrintSystemTime(const SYSTEMTIME *pSTime , LPCSTR szRemark);
#endif
#ifdef RIL_ENABLE_AT_CHANNEL_FOR_ATCI
HRESULT RILDrv_ForwardATCmd(DWORD dwParam, LPDETAILEDRILDEVSPECIFIC  pDevSpec);
HRESULT ParserForwardATCmd(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
extern DWORD g_dwATCI;
extern BOOL g_fATCILogOn;
#endif
#if defined (OEM1_DRIVER_PM) || defined (WAVECOM_DRIVER)
HRESULT RILDrv_UpdateBatteryStatus();
HRESULT RILDrv_EnablePowerSavings(DWORD dwParam);
HRESULT RILDrv_DisablePowerSavings(DWORD dwParam);
#endif // RIL_ENABLE_POWERSAVING
